Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, digital cameras, digital recording devices, digital media players, video gaming devices, video game consoles, cellular or satellite radio telephones, video teleconferencing devices, and the like. Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-2; MPEG-4; ITU-T H.263; ITU-T H.263-P0, MPEG-4, Short Video Header; ITU-T H.264/MPEG-4, Part 10, Advanced Video Coding (AVC); or the emerging High Efficiency Video Coding (HEVC) standard, and extensions of such standards, to transmit and receive digital video information more efficiently.
For block-based video coding, a video frame or slice may be partitioned into video blocks, known as macroblocks (MBs) or coding units (CUs). Video compression techniques perform spatial prediction and/or temporal prediction of the video blocks to reduce or remove redundancy between the video blocks that is inherent in video sequences. Video compression techniques also perform transformation and quantization to reduce the amount of data used to represent the predicted video blocks. In some cases, the bit depth of the quantized transform coefficients may still be larger than the range specified by the video coding standard, and an additional clipping may be performed on the out-of-bound quantized transform coefficients to bring them within the specified range. This clipping results in a loss of data in the encoded video blocks, which may cause undesirable color/gray patches to appear in the video sequence when decoded.